package Test;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
     int a = piao();
     System.out.println("你的机票价格为"+a);
    }

    public static int piao() {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的机票原价");
        int price = sc.nextInt();
        System.out.println("请输入你的机票月份");
        int month = sc.nextInt();
        System.out.println("请输入你的Vip等级");
        String vipLevel = sc.next();
        if (month >= 5 && month <= 10) {
            if ("头等舱".equals(vipLevel)) {
                price = price * 90 / 100;
            } else if ("经济舱".equals(vipLevel)) {
                price = price * 85 / 100;
            }
        }else if ((month >= 11 && month <= 12) || (month >= 1 && month <= 4)) {
            if ("头等舱".equals(vipLevel)) {
                price = price * 70 / 100;
            } else if ("经济舱".equals(vipLevel)) {
                // ... existing code ...
                price = price * 65 / 100;
            }
        }
        return price;
    }
}
